<template>
	<view class="container">
		<view class="first">
			<view class="first-1">注销 {{phonenumber}} 的用户账户</view>
			<view class="first-2">请确保所有的交易已完结且无纠纷</view>
			<view class="first-3">
				<image src="../../static/zx-img.png" mode="aspectFill"></image>
			</view>
			<view class="first-4">
				<image src="../../static/zx-phone.png" mode="widthFix"></image>
			</view>
			<view class="first-5">
				<view class="tips-img" v-if="isSelect2">
					<image src="../../static/tyxieyi.png" mode="widthFix"></image>
				</view>
				<view class="first-5-top">
					<view class="first-5-top-left">
						<u-checkbox-group  placement="row" @change="handleSelect">
							<u-checkbox size="30"  activeColor="#FCC928"  shape="circle"></u-checkbox>
						</u-checkbox-group>
						<!-- <checkbox style="border-radius: 50% !important;color: #FCC928" @click="handleSelect()"></checkbox> -->
					</view>
					<view class="first-5-top-right">
						<text>我已阅读并同意</text>
						<text @click="handleOpenArticle" style="color: #3287D2;padding-left: 5rpx;">《找零工平台账户注销须知》</text>
					</view>
				</view>
				<view class="first-5-bottom" @click="next">
					<image src="../../static/xiayibu.png" mode="aspectFill"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				isSelect:false,
				isSelect2:false,
				phonenumber:''
			}
		},
		onLoad() {
			this.getUserInfo()
		},
		methods: {
			
			async getUserInfo() {
				let res = await this.$fetch(this.$api.get_current_user, {}, 'GET')
				// if (res.code) return
				if (res.code===531) {
					uni.navigateTo({
						url: '/pages/riskControl/riskControl',
					})
					return
				}
				this.phonenumber = res.data.user.phonenumber
				this.phonenumber = this.phonenumber.replace(this.phonenumber.substring(3,7),'****')
				if(res.data.payPwdFlag){
					uni.setStorageSync('isHavePayPassword',true)
				}
				else{
					uni.setStorageSync('isHavePayPassword',false)
				}
			},
			
			
			
			
			handleSelect() {
				this.isSelect = !this.isSelect
				if(this.isSelect){
					this.isSelect2 = false
				}
			},
			next(){
				if(this.isSelect){
					uni.navigateTo({
						url: '/pages/account-security/account-logout'
					})
				}else{
					this.isSelect2 = true
				}
			},
			handleOpenArticle(){
				uni.navigateTo({
					url: '/pages/user-agreement/service-agreement?id=24'
				})
			},
			
		}
		
	}
</script>

<style lang="less" scoped>
.container {
	.first{
		.first-1{
			padding-top: 20rpx;
			font-size: 32rpx;
			    font-weight: 600;
			    padding-left: 44rpx;
		}
		.first-2{
			font-size: 24rpx;
			    padding-left: 44rpx;
			    padding-top: 20rpx;
			    padding-bottom: 20rpx;
		}
		.first-3{
			width: 100%;
			    display: flex;
			    justify-content: center;
			    align-items: center;
			    // border: 1px solid;
				image{
					width: 95%;
					height: 500rpx;
				}
		}
		.first-4{
			display: flex;
			justify-content: center;
			align-items: center;
			padding-top: 20rpx;
			image{
				width: 420rpx;
				height: 100%;
			}
		}
		.first-5{
			position: fixed;
			left: 0;
			bottom: 0;
			width: 100%;
			height: 220rpx;
			background: #fff;
			.tips-img{
				position: absolute;
				left: 10%;
				top: -26rpx;
				image{
					width: 166rpx;
					height: 100%;
				}
			}
			.first-5-top{
				padding-top: 30rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				width: 100%;
				height: 50rpx;
				// border: 1px solid;
				.first-5-top-left{
					padding-right: 10rpx;
				}
				.first-5-top-right{
					font-size: 26rpx;
				}
			}
			.first-5-bottom{
				padding-top: 10rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				image{
					width: 82%;
					height: 90rpx;
				}
			}
		}
	}
	
}
</style>
